<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改数据源')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-datasource-edit" th:object="${datasource}">
            <input id="datasourceId" name="datasourceId" th:field="*{datasourceId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属项目：</label>
				<div class="col-sm-8">
					<input id="projectName" name="projectName" th:field="*{projectName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">数据源名称：</label>
				<div class="col-sm-8">
					<input id="datasourceName" name="datasourceName" th:field="*{datasourceName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">驱动：</label>
				<div class="col-sm-8">
					<input id="driverClassName" name="driverClassName" th:field="*{driverClassName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">库：</label>
				<div class="col-sm-8">
					<input id="tableSchema" name="tableSchema" th:field="*{tableSchema}" class="form-control" type="text">
				</div>

			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">数据源IP：</label>
				<div class="col-sm-3">
					<input id="datasourceIp" name="datasourceIp" th:field="*{datasourceIp}" class="form-control" type="text">
				</div>
				<label class="col-sm-2 control-label">端口：</label>
				<div class="col-sm-3">
					<input id="datasourcePort" name="datasourcePort" th:field="*{datasourcePort}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">用户名：</label>
				<div class="col-sm-8">
					<input id="username" name="username" th:field="*{username}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">密码：</label>
				<div class="col-sm-8">
					<input id="password" name="password" th:field="*{password}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" th:field="*{remark}" class="form-control"></textarea>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "tool/datasource";
		$("#form-datasource-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-datasource-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
